package com.test.dao.impl;

import com.test.dao.OpenOrderHaveDao;

import com.test.domain.OpenOrderHave;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class OpenOrderHaveDaoImpl implements OpenOrderHaveDao {

    @Resource
    private JdbcTemplate jdbcTemplate;


    @Override
    public List<OpenOrderHave> getDishListByOpenOrderNumber(String openOrderNumber) {
        String sql = "select * from V_order_have where open_order_number=?";
        return jdbcTemplate.query(sql,new BeanPropertyRowMapper<OpenOrderHave>(OpenOrderHave.class), openOrderNumber);
    }
}
